package com.gagakuai.engine.impl.pvm.process;

import com.gagakuai.engine.impl.delegate.Expression;
import com.gagakuai.engine.impl.pvm.PvmActivity;
import com.gagakuai.engine.impl.pvm.PvmTransition;

import java.util.Map;

/*
 * @program: common-starters
 * @description: 连线
 * @author: houhong
 * @create: 2023-01-02 17:30
 */
public class TransitionImpl extends ProcessElementImpl implements PvmTransition {


    private static final long serialVersionUID = -4823886924061373945L;
    /*
     * 开始出发点
     */
    private ActivityImpl resource;
    /*
     * 目的地
     */
    private ActivityImpl destination;
    /*
     * 计算表达式
     */
    protected Expression skipExpression;

    public TransitionImpl(String id, ProcessDefinitionImpl processDefinition) {
        super(id, processDefinition);
    }

    public TransitionImpl(String id, ProcessDefinitionImpl processDefinition, Map<String, Object> properties) {
        super(id, processDefinition, properties);
    }

    @Override
    public PvmActivity getResource() {
        return this.resource;
    }

    @Override
    public PvmActivity getDestination() {
        return this.destination;
    }

    @Override
    public Expression getSkipExpression() {
        return this.skipExpression;
    }

    public void setResource(ActivityImpl resource) {
        this.resource = resource;
    }

    public void setDestination(ActivityImpl destination) {
        this.destination = destination;
    }

    public void setSkipExpression(Expression skipExpression) {
        this.skipExpression = skipExpression;
    }
}